import http from "../utils/request"

export const getCaptcha=()=>http.get("/users/getCaptcha?v=next")
// captcha是要传的参数
export const verifyCaptcha=captcha=>http.get("/users/verifyCaptcha",{
    params:{
        captcha
    }
})

export const getSmsCode=phoneNumber=>http.post("/sms/send",{phoneNumber})

export const smsLogin=code=>http.post("/users/login?type=sms",{code})

/**
 * 
 * @param {String} username 用户名
 * @param {String} password 用户密码
 * @returns {Promise} Promise类型
 */

export const login=(username,password)=>http.post("	/users/login",{username,password})

// params传递给后端
export const getQrcode=sid=>http.get("/users/getQrcode",{params:{sid}})

export const wechatLogin = wechatCode => http.get("/users/wechatLogin", { params: { wechatCode } })